﻿@model IEnumerable<DataAccess.Datatypes.User>

@{
    ViewBag.Title = "Manage Users";    
}
<div style="width: 100%; float:left; position:relative; top: 60px; margin-left: 60px; margin-bottom: 60px;"> 
    <h2 class="blue-font-title" style="margin-left: 0;">Manage Users</h2>
    <table>
        <tr>
            <th style="padding-right:10px;">
                <b>@Html.DisplayName("User")</b>
            </th>
            <th style="padding-right:10px;">
                <b>@Html.DisplayName("Infractions")</b>
            </th>
            <th style="padding-right:10px;">
                <b>@Html.DisplayName("Active")</b>
            </th>
            <th></th>
        </tr>

    @foreach (var item in Model) {
        <tr>
            <td style="padding-right:10px;">
                @Html.DisplayFor(modelItem => item.Name)
            </td>
            <td style="padding-right:10px;">
                @Html.DisplayFor(modelItem => item.Infractions)
            </td>
            <td style="padding-right:10px;">
                @if (item.Active)
                {
                    @Html.DisplayName("Yes")
                }
                else
                {
                    @Html.DisplayName("No")
                }
            </td>
            @if (item.Active == true)
            {
                <td style="padding-right:10px;">
                    <b>@Html.ActionLink("Block User", "BlockUser", new { userId=item.id })</b>
                </td>
            }
        </tr>
    }
    </table>
</div>